package com.hr.mq;

import com.hr.system.entity.SysDept;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Slf4j //lombok封装
@Component //IOC创建对象
//@RocketMQMessageListener(topic = "hr_work_approval",consumerGroup = "hr_work_leader")
public class RocketmqListener1 implements RocketMQListener<SysDept> {

    //接收消息
    @Override
    public void onMessage(SysDept s) {
        log.info("消费端，接收消息：{}",s.getId());
        System.err.println("消费端，接收消息："+s);
    }
}